package SingleMode;

/**
 * @author 23737
 * 静态内部类实现单例
 */
public class StaticHolder {

    //构造器私有
    private StaticHolder(){

    }

    //直接获取静态内部类中的对象
    public static StaticHolder getInstance(){
        return InnerClass.staticHolder;
    }

    public static class InnerClass{
        private static final StaticHolder  staticHolder = new StaticHolder();
    }
}
